import {defineStore} from 'pinia';
import AdvertisingList from "@/views/advertising/advertisingList.vue";
import AdvertisingDetails from "@/views/advertising/advertisingDetails.vue";
import AdvertisingPublish from "@/views/advertising/advertisingPublish.vue";
export const useAdvertising = defineStore("advertising", {
  state: () => {
    return {
      currentComponentName: 'list',
    };
  },
  getters: {
    modificationRouter: (state) => {
      const componentObj = [
        { name: "list", component: AdvertisingList },
        { name: "details", component: AdvertisingDetails },
        { name: "publish", component: AdvertisingPublish },
      ];
      const component = componentObj.filter(r=>r.name === state.currentComponentName);
      return component[0].component;
    },
  },
});
